<HTML><HEAD><TITLE>atom_string(?Atom, ?String)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Strings and Atoms</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>atom_string(?Atom, ?String)</H1>
Conversion between an atom and a string.


<DL>
<DT><EM>Atom</EM></DT>
<DD>Atom or variable.
</DD>
<DT><EM>String</EM></DT>
<DD>String or variable.
</DD>
</DL>
<H2>Description</H2>
   If Atom is instantiated, converts it to a string String.

<P>
   If String is instantiated, converts it to an atom Atom.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>atom_string(+, -) is det
<LI>atom_string(-, +) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>Atom is instantiated, but not to an atom.
<DT><EM>(5) type error </EM>
<DD>String is instantiated, but not to a string.
<DT><EM>(4) instantiation fault </EM>
<DD>Neither Atom nor String are instantiated (non-coroutine mode    only).
</DL>
<H2>Examples</H2>
<PRE>
   Success:
   atom_string('Tom',"Tom").
   atom_string(tom,X).                 (gives X="tom").
   atom_string(X,"4").                 (gives X='4').
   Fail:
   atom_string('jo',"joe").
   Error:
   atom_string(X,Y).                   (Error 4).
   atom_string(4,"4").                 (Error 5).
   atom_string(tom,'tom').             (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/stratom/append_strings-3.html">append_strings / 3</A>, <A HREF="../../kernel/stratom/integer_atom-2.html">integer_atom / 2</A>, <A HREF="../../kernel/ioterm/sprintf-3.html">sprintf / 3</A>, <A HREF="../../kernel/termmanip/term_string-2.html">term_string / 2</A>
</BODY></HTML>
